<g:render template="../home/header" ></g:render>
<div class="row wid_1000 blk2 mTo_50">
    <div class="col-xs-12">
        <div class="form-horizontal" >
            <div class="form-group  message %{--alert--}%"> </div>
            <div class="kong_20"></div>
            <div class="form-group form-field field-username">
                <label class="col-sm-3 control-label no-padding-right f_l" for="form-username"> 用户名: </label>
                <div class="col-xs-12 col-sm-4 zc_Rtxt f_l">
                    <g:textField  name="username" id="form-username" placeholder="请输入用户名" class="width-100" />
                </div>
                <div class="help-block col-xs-12 col-sm-reset inline fieldMsg">  </div>
            </div>


            <div class="form-group">
                <label class="col-sm-3 control-label no-padding-right f_l" for="form-validateCode">验证码: </label>
                <div class="col-xs-12 col-sm-4 zc_Rtxt f_l">
                    <g:textField  name="validateCode" id="form-validateCode" placeholder="请输入验证码" class="width-60" />
                    <button class="btn btn-info"  type="button" onclick="${remoteFunction(controller: 'member', action: 'getValidateCode', update: 'validateCodeShow')}">获取验证码</button>
                </div>
                <div id="validateCodeShow">

                </div>


            </div>

            <div class="clearfix form-actions">
                <div class="col-md-offset-3 col-md-9">
                    <button onclick="sendEmail()" class="btn btn-info" >
                        <i class="icon-ok bigger-110"></i>
                        确定
                    </button>
                </div>
            </div>
        </div>
    </div>
</div>


<r:require module="mng_form"></r:require>
<r:script>
       function sendEmail() {
                $.ajax({
                    type: "POST",
                    url: "<g:createLink controller="member" action="sendPwd "/>",
                    data: {username:$('#form-username').val(),validateCode:$('#form-validateCode').val()},
                    dataType: "json",
                    success: function (data) {

                        alert(data.message);
                    },
                    error: function (data, status, e)//服务器响应失败处理函数
                    {
                        alert("请求错误");
                    }
                });
        }
</r:script>


<g:render template="../home/footer" ></g:render>